import 'package:flutter_boss_mine/eneity/position_entity.dart';

positionEntityFromJson(PositionEntity data, Map<String, dynamic> json) {
	if (json['status'] != null) {
		data.status = json['status']?.toInt();
	}
	if (json['count'] != null) {
		data.count = json['count']?.toInt();
	}
	if (json['msg'] != null) {
		data.msg = json['msg']?.toString();
	}
	if (json['data'] != null) {
		data.data = new List<PositionData>();
		(json['data'] as List).forEach((v) {
			data.data.add(new PositionData().fromJson(v));
		});
	}
	return data;
}

Map<String, dynamic> positionEntityToJson(PositionEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['status'] = entity.status;
	data['count'] = entity.count;
	data['msg'] = entity.msg;
	if (entity.data != null) {
		data['data'] =  entity.data.map((v) => v.toJson()).toList();
	}
	return data;
}

positionDataFromJson(PositionData data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id']?.toInt();
	}
	if (json['name'] != null) {
		data.name = json['name']?.toString();
	}
	if (json['img'] != null) {
		data.img = json['img']?.toString();
	}
	if (json['title'] != null) {
		data.title = json['title']?.toString();
	}
	if (json['workingTM'] != null) {
		data.workingTM = json['workingTM']?.toString();
	}
	if (json['education'] != null) {
		data.education = json['education']?.toString();
	}
	if (json['Tags'] != null) {
		data.tags = json['Tags']?.map((v) => v?.toString())?.toList()?.cast<String>();
	}
	if (json['company'] != null) {
		data.company = json['company']?.toString();
	}
	if (json['companyState'] != null) {
		data.companyState = json['companyState']?.toString();
	}
	if (json['employ'] != null) {
		data.employ = json['employ']?.toString();
	}
	if (json['postion'] != null) {
		data.postion = json['postion']?.toString();
	}
	if (json['address'] != null) {
		data.address = json['address']?.toString();
	}
	if (json['salary'] != null) {
		data.salary = json['salary']?.toString();
	}
	return data;
}

Map<String, dynamic> positionDataToJson(PositionData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['img'] = entity.img;
	data['title'] = entity.title;
	data['workingTM'] = entity.workingTM;
	data['education'] = entity.education;
	data['Tags'] = entity.tags;
	data['company'] = entity.company;
	data['companyState'] = entity.companyState;
	data['employ'] = entity.employ;
	data['postion'] = entity.postion;
	data['address'] = entity.address;
	data['salary'] = entity.salary;
	return data;
}